<?php

require('conf/configuration.php');

class DBConnection {
	
	private static $instance;
 
	private function __construct(){
    	self::$instance = mysql_connect(DB_HOST, DB_USERNAME, DB_PASSWORD) or DIE("Database error conexion");
        $db = mysql_select_db(DB_SCHEMA, self::$instance) or DIE("Unable to select DB");
    }
 	
    public static function getInstance(){
		if(empty(self::$instance)){
			self::$instance = new DBConnection();
        }
        return self::$instance;
  	}
}
?>